<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="${aier_keyworks}" name="keywords">
<meta content="${aier_description}" name="description">
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/btn.css" />
<link rel="stylesheet" href="${aier_css_url}social/user/ujscb.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />


<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>

<link rel="stylesheet" href="${aier_css_url}social/module/aier-ui.css" />
<script type="text/javascript" src="${aier_js_url}aier-ui.js"></script>


<script type="text/javascript">
	var global_suffix = "${aier_suffix}", global_url = "${aier_url}", global_uri = "${aier_uri}", global_urijs = "${aier_urijs}", 
global_cid = "${cid}", global_tid = "${tid}",global_buid = "${buid}",global_userin_url = "${video_user_in_url}",global_userout_url = "${video_user_out_url}";
</script>

</head>
<body data-pagetitle="购买记录" data-view="pay" class="view-ujscb">

	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user" executeResult="true"></s:action>
	<!-- 顶栏结束 -->

	<div class="window-content" style="min-height: 500px;">
		<div class="wrap wrap-payrecode" style="min-height: 500px;">
<!-- 			<div class="nav">
				<span data-special="">&laquo;</span>
				<a class="" href="${aier_url}user/userhscb_list${aier_suffix}?buid=${buid}&bname=${bname}&cid=${cid}">返回</a>
			</div> -->



			<!-- ^^^左侧导航栏 -->
			<div class="nav-side">
				<!-- 家校联系簿（家长） 头像（孩子的） -->
				<div class="ujscb-userinfo">
					<dl class="clearfix">
						<dt style="" data-log="头像" class="avatar">
							<a href="${aier_url}user/uccomm_userCenter.shtml"> <img src="${get_picturl_url}small/${userInfo.headimg}"></a>
						</dt>

						<dd class="nickname">
							<a href="${aier_url}user/uccomm_userCenter.shtml">${userInfo.nickname}</a>
						</dd>
						
						<dd class="overage-status">
							<div class="explain">
								<span id = "edate"></span>
								<a>续费</a>
							</div>
						</dd>

					</dl>
				</div>
				<!-- / 管理员头像 -->
				<div class="ujscb-sidetab-parent">
					<div class="nav-item">
						<a class="btn btn-white-3" href="${aier_url}${aier_uri}userhscb_userChiHSConBook${aier_suffix}?buid=${buid}&bname=${bname}&cid=${cid}&edate=${edate}"><span>家校联系簿</span></a>
					</div>
					<div class="nav-item">
						<a class="btn btn-white-3" href="${aier_url}${aier_uri}pay_selOrders${aier_suffix}?buid=${buid}&bname=${bname}&cid=${cid}"><span>购买应用</span></a>
					</div>
					<div class="nav-item">
						<a class="btn btn-white-3 btn-dialog-usb-intro" href="javascript:void(0);"><span>应用介绍</span></a>
					</div>
					<div class="nav-item current">
						<a class="btn btn-white-3" href="${aier_url}${aier_uri}pay_payRecode${aier_suffix}?buid=${buid}&bname=${bname}&cid=${cid}"><span>购买记录</span></a>
					</div>
				</div>

				<!-- ^^^应用介绍 -->
				<s:action name="userhscb_userHSCBintro" namespace="/user" executeResult="true"></s:action>
				<!-- $$$应用介绍 -->


			</div>
			<!-- $$$左侧导航栏 -->
			<div class="right">
				<div class="table-recode">

					<h3 style="padding: 10px 0;">购买记录</h3>
					<table id="payRecodeTable"></table>
					<div id="payRecodePage"></div>


				</div>
			</div>
		</div>
		
		<!-- footer copyright -->
		<s:action name="userhomecomm_homeFooter" namespace="/user" executeResult="true"></s:action>
		<!-- /footer copyright -->
	</div>

<div class="layer-popup"></div>

</body>
<script type="text/javascript">
	
	


searchPayRecodeList(); // 查询购买记录



function searchPayRecodeList() {
    
    $("#payRecodeTable").jqGrid({
        url:'${aier_url}${aier_urijs}pay_ShowBillList${aier_suffix}',
        datatype:"json",                
        mtype:'GET',
        height:'560',
        width:'700',              
        colNames:['应用名称','日期','金额','交易状态','状态'],                
        colModel:[                    
        {name:'commodity_name',index:'commodity_name',width:100,align:'center'},                                     
        {name:'cdate_str',index:'cdate_str',width:80,align:'center'},
        {name:'money',index:'money',width:80,align:'center'},
        {name:'recode_status',index:'recode_status',width:80,align:'center'},
        {name:'state',index:'state',width:80,align:'center',hidden:true}
        ],
        jsonReader: {
            root:"billList",
            page: "page",
            total: "page_count",
            records : "count",
            repeatitems: false
        },
        pager: jQuery("#payRecodePage"),
        prmNames : {page:"page",sort: "sort"},
        rowNum: 10,
        hidegrid: false,
        viewrecords: true,
        // caption: '购买记录',
        gridComplete:function(){
			var ids=jQuery("#payRecodeTable").jqGrid('getDataIDs');
			for(var i=0; i<ids.length; i++){
				var id=ids[i];   
				var state = jQuery("#payRecodeTable").jqGrid('getRowData', id).state;
								
				if(state==0){
					re = "未支付";
				}else if(state==1){
					re = "支付成功";	
				}else{
					re = "支付失败";
				}
				jQuery("#payRecodeTable").jqGrid('setRowData', ids[i], {recode_status:re});
			}
        	
        }
    }).navGrid("#payRecodePage", { edit: false, add: false, del: false, search: false });
    
}


$('.btn-usb-dialog').click(function(){
	$('.dialog')
});

</script>
</html>